package com.kx.springboot.controller;

import com.kx.springboot.bean.Student;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StudentController {
    @RequestMapping("/say")
    public Object say(Integer id,Integer age){
        return "id:"+id+",age"+age;
    }
    @RequestMapping(value = "/select/{id}/{age}")
    public Object select(@PathVariable Integer id,
                         @PathVariable Integer age){
        Student student=new Student();
        student.setId(id);
        student.setAge(age);
        return "id"+student.getId()+",age"+student.getAge();
    }
    @RequestMapping("/delete/{id}")
    public Object delete(@PathVariable Integer id){
        return "delete:"+id;
    }
    @RequestMapping("/add/{id}")
    public Object add(@PathVariable Integer id){
        return "add:"+id;
    }
    @RequestMapping("/update/{id}")
    public Object update(@PathVariable Integer id){
        return "update:"+id;
    }
}
